var http = require('http');
const config = require('./config').config;

var server = http.createServer(function(req, res)
{
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/plain');

    switch(req.url){
        case '/home':
        res.end('home page ');
        break;
        case '/about':
        res.end('this is about page');
        break;
        default:
        res.end('page not found');
    }
});

server.listen(config.port, config.host, () => {
    console.log('server is running at 3000');
});